/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package frc.circuitrunners.RobotSubsystems.DriveTrain;

import edu.wpi.first.wpilibj.*;
import frc.circuitrunners.IO.IO;
import frc.circuitrunners.R;
import frc.circuitrunners.RobotSubsystems.RobotSubsystem;
import frc.circuitrunners.Scheduler;
/**
 *
 * @author CircuitRunners
 */
public class BridgeDepressor extends RobotSubsystem{

    private Victor BD;
    
    public void runAutonomous() {
        if(!flag){
            switch(R.STAGE){
                case R.stage.PREPARATION:
                    flag = true;
                    Scheduler.yield();
                case R.stage.SHOOT:
                    flag = true;
                    Scheduler.yield();
                case R.stage.BACKUP:
                    flag = true;
                    Scheduler.yield();
                case R.stage.BALL_SMASH:
                    flag = true;
                    Scheduler.yield();
            }
        }
    }

    public void init() {
        BD = new Victor(2,1);
    }

    public void runTeleop() {
        if(IO.getInput(IO.JOY_RIGHT | IO.BUTTON | 3) == 1.0 || IO.getInput(IO.JOY_RIGHT | IO.BUTTON | 3) == 1.0){
            BD.set(0.5);
        } else {
            if(IO.getInput(IO.DIGITAL_INPUT | 3) == 1.0){
                BD.set(0.0);
            } else {
                BD.set(0.1);
            }
        }
    }

    public void disable() {
        BD.set(0.0);
    }

    public void autoAim() {
        disable();
    }
    
}
